﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WF1.lab01
{
    public partial class frmResult : Form
    {
        public frmResult()
        {
            InitializeComponent();
        }

        public frmResult(String username, String fullname, Boolean gender, String email, String phone, String birthday, String education, CheckedListBox favorites, String languages)
        {
            InitializeComponent();
            //
            //Username
            //
            lblUsername.Text = username;
            //
            //Fullname
            //
            lblFullname.Text = fullname;
            //
            //Gender
            //
            if (gender)
            {
                lblGender.Text = "Male";
            }
            else
            {
                lblGender.Text = "Female";
            }
            //
            //Email
            //
            lblEmail.Text = email;
            //
            //Phone
            //
            lblPhone.Text = phone;
            //
            //Birthday
            //
            lblBirthday.Text = birthday;
            //
            //Education
            //
            lblEducation.Text = education;
            //
            //Favorites
            //
            bool first = true;
            if (favorites.CheckedItems.Count > 0) lblFavorites.Text = "";
            for (int i = 0; i < favorites.CheckedItems.Count; i++)
            {
                if (i > 2)
                {
                    lblFavorites.Text += ",...";
                    break;
                }
                if (!first)
                {
                    lblFavorites.Text += ", ";
                }
                lblFavorites.Text += favorites.CheckedItems[i].ToString();
                first = false;
            }
            //
            //Languages
            //
            lblLanguages.Text = languages;
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        
    }
}
